import { ApiCall } from "tsrpc";
import { ReqUpdateSchool, ResUpdateSchool } from "../../shared/protocols/Select/PtlUpdateSchool";
import { Global } from '../../Global/index';

export default async function (call: ApiCall<ReqUpdateSchool, ResUpdateSchool>) {
    // TODO
    const school = call.req.school
    const user = call.currentUser

    await Global.collection('users').updateOne({
        _id:user._id,
    },{
        $set:{
            school
        }
    })

    call.succ({
        
    })
}